import java.util.ArrayList;
import java.util.Iterator;

public class E08_Gerbil {
	private static void hop(Iterator<Gerbil> it) {
		while (it.hasNext()) {
			Gerbil g = it.next();
			g.hop();
		}
	}

	public static void main(String[] args) {
		ArrayList<Gerbil> gerbils = new ArrayList<Gerbil>();
		gerbils.add(new Gerbil());
		gerbils.add(new Gerbil());
		gerbils.add(new Gerbil());
		gerbils.add(new Gerbil());
		gerbils.add(new Gerbil());
		hop(gerbils.iterator());
	}
}
